package com.linked.pay.pay.service.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.linked.pay.pay.bean.dto.PayLogDTO;
import com.linked.pay.pay.bean.po.PayLogPO;
import com.linked.pay.pay.mapper.IPayLogMapper;
import com.linked.pay.pay.service.IPayLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :dbq
 * @date : 2023/3/2 15:09
 * @description : desc
 */
@Service
public class PayLogServiceImpl implements IPayLogService {

    private final ObjectMapper mapper;

    private final IPayLogMapper payLogMapper;

    @Autowired
    public PayLogServiceImpl(ObjectMapper mapper, IPayLogMapper payLogMapper) {
        this.mapper = mapper;
        this.payLogMapper = payLogMapper;
    }

    @Override
    public void addPayLog(PayLogDTO logInfo) throws Exception {
        payLogMapper.insert(new PayLogPO(logInfo));
    }
}
